import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-09-22
 * Time: 20:48
 */
public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String info = in.nextLine();
        String info2 = in.nextLine();
        int[] hash = new int[128];
        for(int i = 0; i < info2.length(); i++) {
            char ch = info2.charAt(i);
            hash[ch] = 1;
        }
        char[] arr = info.toCharArray();
        for(int i = 0; i < arr.length; i++) {
            if(hash[arr[i]] != 1) {
                System.out.print(arr[i]);
            }
        }
    }
}
